﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace iTeamyou.LTS.Core.Models
{
	/// <summary>
	/// 供应商
	/// </summary>
	public class Supplier
    {
        /// <summary>
        /// 供应商编号（长）
        /// </summary>
        [DisplayName("供应商编号")]
        [Description("供应商编号")]
        //[Required(ErrorMessage = "供应商编号不能为空")]
        public string? SId { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        [DisplayName("供应商名称")]
        [Description("供应商名称")]
        [Required(ErrorMessage = "供应商名称不能为空")]
        public string Name { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [DisplayName("联系人")]
        [Description("联系人")]
        //[Required(ErrorMessage = "联系人不能为空")]
        public string? Contact { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [DisplayName("联系电话")]
        [Description("联系电话")]
        public string? ContactNumber { get; set; }

        /// <summary>
        /// 区域
        /// </summary>
        [DisplayName("区域")]
        [Description("区域")]
        //[Required(ErrorMessage = "区域不能为空")]
        public Region Region { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        [Description("创建时间")]
        public DateTime? CreatedOn { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        [DisplayName("创建者")]
        [Description("创建者")]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 最近更新时间
        /// </summary>
        [DisplayName("最近更新时间")]
        [Description("最近更新时间")]
        public DateTime? LastModifiedOn { get; set; }

        /// <summary>
        /// 最近更新者
        /// </summary>
        [DisplayName("最近更新者")]
        [Description("最近更新者")]
        public string LastModifiedBy { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [DisplayName("状态")]
        [Description("状态")]
        //[Required(ErrorMessage = "状态不能为空")]
        public Status? Status { get; set; }

        /// <summary>
        /// 证照数
        /// </summary>
        [DisplayName("证照数")]
        [Description("证照数")]
        public int LicenseNum { get; set; }

        /// <summary>
        /// 供应商证照
        /// </summary>
        [DisplayName("供应商证照")]
        [Description("供应商证照")]
        [Required]
        public List<SupplierLicense> SupplierLicenses { get; set; }

        /// <summary>
        /// 系统唯一标识
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 供应商编号（短）
        /// 目前用于关联同步
        /// </summary>
        public string? RefId { get; set; }
    }

    /// <summary>
	/// 导出供应商
	/// </summary>
	public class ExportSupplier
    {
        /// <summary>
        /// 供应商编号
        /// </summary>
        [DisplayName("供应商编号")]
        [Description("供应商编号")]
        public string Id { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        [DisplayName("供应商名称")]
        [Description("供应商名称")]
        public string Name { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [DisplayName("联系人")]
        [Description("联系人")]
        public string Contact { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [DisplayName("联系电话")]
        [Description("联系电话")]
        public string ContactNumber { get; set; }

        /// <summary>
        /// 区域
        /// </summary>
        [DisplayName("区域")]
        [Description("区域")]
        public Region Region { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        [Description("创建时间")]
        public DateTime? CreatedOn { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        [DisplayName("创建者")]
        [Description("创建者")]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 最近更新时间
        /// </summary>
        [DisplayName("最近更新时间")]
        [Description("最近更新时间")]
        public DateTime? LastModifiedOn { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [DisplayName("状态")]
        [Description("状态")]
        public Status? Status { get; set; }

        /// <summary>
        /// 供应商证照
        /// </summary>
        [DisplayName("供应商证照")]
        [Description("供应商证照")]
        [BizDataType("ListURL")]
        public List<string>? SupplierLicenseUrl { get; set; }
    }

    /// <summary>
    /// 区域类型
    /// </summary>
    public enum Region
    {
        /// <summary>
        /// 全国
        /// </summary>
        [Description("全国")]
        Quanguo = 1,

        /// <summary>
        /// 华东
        /// </summary>
        [Description("华东")]
        Huadong = 2,

        /// <summary>
        /// 华南
        /// </summary>
        [Description("华南")]
        Huanan = 3,

        /// <summary>
        /// 华中
        /// </summary>
        [Description("华中")]
        Huazhong = 4,

        /// <summary>
        /// 华北
        /// </summary>
        [Description("华北")]
        Huabei = 5,

        /// <summary>
        /// 西北
        /// </summary>
        [Description("西北")]
        Xibei = 6,

        /// <summary>
        /// 西南
        /// </summary>
        [Description("西南")]
        Xinan = 7,

        /// <summary>
        /// 东北
        /// </summary>
        [Description("东北")]
        Dongbei = 8,

        /// <summary>
        /// 台港澳
        /// </summary>
        [Description("台港澳")]
        TaiGangAo = 9,

        /// <summary>
        /// 未设置
        /// </summary>
        [Description("未设置")]
        Unknown = 0,
    }

    /// <summary>
    /// 状态类型
    /// </summary>
    public enum Status
    {
        /// <summary>
        /// 合作中
        /// </summary>
        [Description("合作中")]
        InCooperation = 1,

        /// <summary>
        /// 不合作
        /// </summary>
        [Description("不合作")]
        Noncooperation = 0
    }
}

